package com.yida.gwj.expend.outside.domain.request;

import cn.hutool.core.util.ObjectUtil;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.time.LocalDate;

/**
 * 保存拨付申请业务请求参数
 *
 * @author wkz
 * @date 2023/03/16
 */
@ApiModel(description = "保存拨付申请业务请求参数")
public class SaveAppropriateApplyRequest {

    private static final long serialVersionUID = 1L;

    /**
     * 业务标识（cate_id）
     */
    @NotNull(message = "业务标识不能为空")
    @ApiModelProperty(name = "业务标识")
    private Integer bizFlagId;

    /**
     * 业务ID(yw_id)
     */
    @ApiModelProperty(value = "业务ID(yw_id)")
    @NotNull(message = "业务ID（bizId）不能为空")
    private Long bizId;

    @NotBlank(message = "申请单位不能为空")
    @ApiModelProperty(value = "申请单位全称(shenqingdanwei_quancheng)")
    private String applicationUnitName;

    /**
     * 决算总金额(juesuanzongjine)
     */
    @ApiModelProperty("决算总金额(juesuanzongjine)")
    private BigDecimal totalSettlementAmount;

    @NotBlank(message = "联系人不能为空")
    @ApiModelProperty(value = "联系人(lianxiren)")
    private String contacts;

    @ApiModelProperty(value = "联系电话")
    @NotBlank(message = "联系电话不能为空")
    private String phone;

    @NotNull(message = "维修竣工日期不能为空")
    @ApiModelProperty(value = "维修竣工日期")
    private LocalDate repairCompletionDate;

    public Integer getBizFlagId() {
        return bizFlagId;
    }

    public void setBizFlagId(Integer bizFlagId) {
        this.bizFlagId = bizFlagId;
    }

    public Long getBizId() {
        return bizId;
    }

    public void setBizId(Long bizId) {
        this.bizId = bizId;
    }

    public String getApplicationUnitName() {
        return applicationUnitName;
    }

    public void setApplicationUnitName(String applicationUnitName) {
        this.applicationUnitName = applicationUnitName;
    }

    public String getContacts() {
        return contacts;
    }

    public void setContacts(String contacts) {
        this.contacts = contacts;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public LocalDate getRepairCompletionDate() {
        return repairCompletionDate;
    }

    public void setRepairCompletionDate(LocalDate repairCompletionDate) {
        this.repairCompletionDate = repairCompletionDate;
    }

    public BigDecimal getTotalSettlementAmount() {
        if(ObjectUtil.isNull(totalSettlementAmount)){
            return BigDecimal.ZERO;
        }
        return totalSettlementAmount;
    }

    public void setTotalSettlementAmount(BigDecimal totalSettlementAmount) {
        this.totalSettlementAmount = totalSettlementAmount;
    }

    @Override
    public String toString() {
        return "SaveAppropriateApplyRequest{" +
                "bizFlagId=" + bizFlagId +
                ", bizId=" + bizId +
                ", applicationUnitName='" + applicationUnitName + '\'' +
                ", totalSettlementAmount=" + totalSettlementAmount +
                ", contacts='" + contacts + '\'' +
                ", phone='" + phone + '\'' +
                ", repairCompletionDate=" + repairCompletionDate +
                '}';
    }
}
